import request from "@/utils/request";

//模拟数据，去掉这个调用真实接口
// import mock from "@/utils/mock";

export default {
  getList: (query, pageNum = 1, pageSize = 10) => {
    let url = `api/v1/form/getPageList?current=${pageNum}&size=${pageSize}`;
    if (query.search) url += `&itemName=${query.search}`;
    return request({
      url: url,
      method: "GET",
      data: query,
    });
  },
  addProj: (param) => {
    return request({
      url: `api/v1/form/insert`,
      method: "POST",
      data: param,
    });
  },


  login: (param) => {
    return request({
      url: `api/toLogin`,
      method: "POST",
      data: param,
      headers: {

      },
      withCredentials: true


    });
  },
  getForm: (formId) => {
    return request({
      url: `api/v1/form/select/${formId}`,
      method: "GET",
    });
  },
  saveForm: (data) => {
    return request({
      url: `api/v1/form/update`,
      method: "PUT",
      data: data,
    });
  },
  deleteProj: (id) => {
    return request({
      url: `api/v1/form/delete/${id}`,
      method: "DELETE",
    });
  },
  calculate:(data)=>{
    return request({
      url: `api/v1/calc/`,
      method: "POST",
      data:data
    });
  }

};
